package com.kangtu.demoaskpager.ask.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kangtu.demoaskpager.ask.entity.TbAsk;
import com.kangtu.demoaskpager.ask.mapper.TbAskMapper;
import com.kangtu.demoaskpager.ask.service.ITbAskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kangtu.demoaskpager.util.ResponseResult;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 问题库 服务实现类
 * </p>
 *
 * @author david
 * @since 2021-03-23
 */
@Service
public class TbAskServiceImpl extends ServiceImpl<TbAskMapper, TbAsk> implements ITbAskService {

    @Override
    public ResponseResult getAskByPage(Integer pageNo, Integer pageSize) {
        ResponseResult result = ResponseResult.SUCCESS();

        Page page = new Page(pageNo, pageSize);
        Page asks = page(page);

        result.setResult(asks);

        return result;
    }
}
